home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / PAS_0493 / CURSOR.PAS < prev    next >
Pascal/Delphi Source File  |  1993-04-22  |  2KB  |  68 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 427 of 473
  3. From : Jon Jasiunas                        1:273/216.0          08 Apr 93  21:56
  4. To   : Daniel Shapiro
  5. Subj : Hiding cursor
  6. ────────────────────────────────────────────────────────────────────────────────
  7. DS>      I have another one- How do I "hide" the cursor?  So when it is waiting
  8.   >for input, I won't see that stupid little blinking cursor there...
  9.  
  10.     cut here --- }
  11. unit Cursor;
  12.  
  13. interface
  14.  
  15. uses
  16.   Crt, Dos;
  17.  
  18. type
  19.   CursorType = (cmOn, cmOff, cmUnderline, cmHalf, cmBlock);
  20.  
  21. procedure GetCursorMode(var Regs : Registers);
  22.  
  23. implementation
  24.  
  25.   procedure GetCursorMode(var Regs : Registers);
  26.   begin
  27.     Regs.Ah := $03;
  28.     Intr($10, Regs);
  29.   end;  { GetCursorMode }
  30.  
  31. procedure SetCursor(Mode : CursorType);
  32. var
  33.   Regs : Registers;
  34.  
  35. begin   { SetCursor }
  36.   GetCursorMode(Regs);
  37.   With Regs do
  38.     begin
  39.       Case Mode of
  40.         cmOn : Ch := Ch and $1F;
  41.         cmOff: Ch := Ch or $20;
  42.         Else
  43.           Case Lastmode of
  44.             $07 : begin
  45.                     Case Mode of
  46.                       cmUnderline : Ch := $0B;
  47.                       cmHalf      : Ch := $07;
  48.                       cmBlock     : Ch := $00;
  49.                     end;  { Case Mode }
  50.                     Cl := $0C;
  51.                   end { $07 }
  52.           Else
  53.             begin
  54.               Case Mode of
  55.                 cmUnderline : Ch := $06;
  56.                 cmHalf      : Ch := $04;
  57.                 cmBlock     : Ch := $00;
  58.               end;  { Case Mode }
  59.               Cl := $07;
  60.             end;  { Else Case }
  61.           end;  { Case Lastmode }
  62.       end;  { Case Mode }
  63.       Ah := $01;
  64.     end;  { With Regs }
  65.   Intr($10, Regs);
  66. end;  { SetCursor }
  67.  
  68. end.